program Spiski3;

{$APPTYPE CONSOLE}

uses
  SysUtils;

type
  pelement = ^ element;
  element = record
    value: integer;
    next: pelement;
  end;

procedure AddToBeginning (var head: pelement; num: integer);
var
  tmp: pelement;

begin
  tmp:= head;
  new (head);
  head^.next:=tmp;
  head^.value:=num;
end;

procedure PrintList (head: pelement);
var
  current: pelement;
begin
  current:=head;
  while (current <> nil) do
  begin
    writeln(current^.value);
    current:=current^.next;
  end;
end;

procedure AddToEnd (var head: pelement; num: integer);
var
  current: pelement;
begin
  if (head <> nil) then
  begin
    current:=head;
    while (current^.next <> nil) do
    begin
      current:=current^.next;
    end;
    new (current^.next);
    current^.next^.value:=num;
    current^.next^.next:=nil;
  end else begin
    AddToBeginning (head, num);
  end;
end;

procedure BubbleOne (var head: pelement);
var
  curr1, curr2: pelement;
  val1, val2: Integer;

begin
  curr1:=head;
  curr2:=curr1^.next;
  while curr2 <> nil do
  begin
    if curr1^.value > curr2^.value then
    begin
      val1:=curr1^.value;
      val2:=curr2^.value;
      curr1^.value:=val2;
      curr2^.value:=val1;
    end;
    curr1:=curr1^.next;
    curr2:=curr2^.next;
  end;
end;

var
  head: pelement;
  inp: Textfile;
  n, a, i: integer;

begin
  AssignFile (inp, 'inputs3.txt');
  Reset (inp);
  head:=nil;
  Read (inp, n);
  for i:= 1 to n do
  begin
    Read (inp, a);
    AddToEnd (head, a);
  end;
  BubbleOne (head);
  PrintList (head);
  Readln;
  CloseFile (inp);
end.
